/**
 * Package:com.goldcitynet.util.code;
 * $Id$
 * Copyright(c) 2001-2005 www.afteryuan.com
 */
package com.kmpro.util.code;

import java.io.FilenameFilter;
import java.io.File;

/**
 * ConfigureStringUtil
 * <p/>
 * <p><a href="ConfigureStringUtil.java.html"><i>View Source</i></a></p>
 *
 * @author <a href="mailto:afteryuan@afteryuan.com">$Author$</a>
 * @version $Revision$
 */
public class ConfigureStringUtil {
    public static void main(String[] args) {
        java.io.File file = new java.io.File("D:\\project\\goldcity_platform\\src\\java\\com\\afteryuan\\model");
        String[] n = file.list(new FilenameFilter(){
            public boolean accept(File dir, String name) {
                return name.toLowerCase().endsWith("java")&&!name.toLowerCase().startsWith("base");
            }
        });

        for (int i = 0; i < n.length; i++) {
            if(n[i].endsWith("svn"))continue;
            if (n[i].split("[.]").length > 1)
                System.out.println("<bean id=\"" + (n[i].length() > 0 ? n[i].substring(0, 1).toLowerCase() : "") + n[i].substring(1, ((n[i].length() - 5) > 0 ? (n[i].length() - 5) : 0)) + "Service\" class=\"com.kmpro.service.impl." + n[i].substring(0, ((n[i].length() - 5) > 0 ? (n[i].length() - 5) : 0)) + "ServiceImpl\"/>");
        }
        System.out.println("---------------------------------------");
        for (int i = 0; i < n.length; i++) {
            System.out.println("ant gen -Dmodel.name=" + n[i].substring(0, ((n[i].length() - 5) > 0 ? (n[i].length() - 5) : 0)));
        }
        System.out.println("---------------------------------------");
        for (int i = 0; i < n.length; i++) {
            System.out.println("<mapping class=\"com.kmpro.model." + n[i].substring(0, ((n[i].length() - 5) > 0 ? (n[i].length() - 5) : 0)) + "\"/>");
        }
        System.out.println("---------------------------------------");
        for (int i = 0; i < n.length; i++) {
            System.out.println("<value>com.kmpro.model." + n[i].substring(0, ((n[i].length() - 5) > 0 ? (n[i].length() - 5) : 0)) + "</value>");
        }

    }
}
